package pri.zxx.word.dat;


import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import pri.zxx.word.WordBaseDataProperties;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class WordData extends AbstractWordData {

    private WordBaseDataProperties wordBaseDataProperties;

    @Schema(name = "试验编号")
    private String experimentNo = "123123123213";

    @Schema(name = "试验名称")
    private String experimentName = "zxxTest";

    @Schema(name = "试验动物品种")
    private String animalType ="生长育肥猪";

    @Schema(name = "试验负责人名称")
    private String experimentUserName = "zxx";

    @Schema(name = "报告日期")
    private String experimentTime = "2022年06月01日";

    /* ***************************  page1        **************************/

    @Schema(name = "试验目的")
    private String experimentTarget = "匹配括号的正则表达式";

    @Schema(name = "试验动物数量")
    private Integer animalCount = 100;

    @Schema(name = "单位")
    private String unit = "组";

    @Schema(name = "分组数量")
    private Integer groupCount = 5;

    @Schema(name = "重复数量")
    private Integer repeatTimes = 6;

    @Schema(name = "关键词")
    private List<String> keywords = Arrays.asList("1", "2", "3");

    /* ***************************   分组情况       **************************/
    private List<GroupInfo> groupInfos;

    /* ***************************   阶段数据       **************************/
    @Schema(name = "阶段数据")
    private List<StageInfo> stageInfoList;

    @Schema(name = "试验结果数据")
    private List<ExperimentResult> experimentResults;




    @Data
    @Accessors(chain = true)
    public static class GroupInfo {
        private Long groupId;
        private String groupName;
        private String desc;
        private Integer order;
    }


    @Data
    @Accessors(chain = true)
    public static class SimpleTableInfo {
        private Long stageId;
        private Long groupId;
        private String name;
        private BigDecimal value;
    }

    @Data
    @Accessors(chain = true)
    public static class StageInfo {
        @Schema(name = "阶段名称")
        private String stageName;

        @Schema(name = "阶段描述")
        private String desc;

        @Schema(name = "开始日龄")
        private Integer startDays;

        @Schema(name = "结束日龄")
        private Integer endDays;

        @Schema(name = "原料数据")
        private List<SimpleTableInfo> rawInfos;

        @Schema(name = "营养指标数据")
        private List<SimpleTableInfo> nutritionInfo;
    }
}
